package com.weihj;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by weihuajiang on 2017/7/4.
 */
@RestController
@Api(value = "user", description = "用户")
@RequestMapping("/users")
public class UserController {


    @ApiOperation(value = "获取用户")
    @RequestMapping(value = "/get", method = RequestMethod.GET)
    public User getUser() {
        return new User();
    }

    @ApiOperation("新增用户")
    @RequestMapping(value = "/save", method = RequestMethod.POST)
    User saveUser(@ModelAttribute User user) {
        return new User();
    }

    @ApiOperation("查询用户")
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    List<User> listUsers() {
        List<User> userList = new ArrayList<User>();
        return userList;
    }
}
